import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()



import configs from './config/wap.js'
Vue.prototype.$config = configs;


Vue.mixin({
	data() {
		return {

		}
	},
	onShow() {},
	methods: {
		toPage(url, is_tab = false) {
			if (is_tab == 'loginout') {
				uni.$showMsg('退出成功')
			} else if (is_tab) {
				uni.switchTab({
					url
				})
			} else {
				uni.navigateTo({
					url
				})
			}
		},
		loginPage(url, is_login = false, need = true) {
			if (!need || (need && is_login)) {
				uni.navigateTo({
					url
				})
			} else {
				uni.$showMsg('请先登录')
			}
		}
	}
})

// #endif

uni.$showMsg = function(title = "数据加载失败！", duration = 1500) {
	uni.showToast({
		title: title.toString(),
		duration,
		icon: 'none'
	})
}



// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif